Patrones Puntuales Espaciales

Author

Santiago Rojas

Paquetes:

library(tidyverse)
library(magrittr)
library(sf)
library(spatstat)
library(mapview)

DB:

https://www.kaggle.com/datasets/START-UMD/gtd

colombia <- st_read("Maps_Shapes_and_Objects/MGN_DPTO_POLITICO.shp")
Reading layer `MGN_DPTO_POLITICO' from data source 
  `/home/sr/UN/2023-1/Spatial_Statistics/Project/Project_Spatial_Point_Pattern/spatial_statistics_project-Spatial-Point-Patterns/Maps_Shapes_and_Objects/MGN_DPTO_POLITICO.shp' 
  using driver `ESRI Shapefile'
Simple feature collection with 33 features and 9 fields
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: -81.73562 ymin: -4.229406 xmax: -66.84722 ymax: 13.39473
Geodetic CRS:  MAGNA-SIRGAS
border_col <- st_coordinates(colombia$geometry)
db <- read.csv("Data/Colombia_Terrorism.csv")
coord <- data.frame(x=as.numeric(db$longitude), y=as.numeric(db$latitude))
load("Maps_Shapes_and_Objects/Contour_Points.RData")
mapview(colombia, legend=F, col.regions="gray") + 
  mapview(coord, xcol="x", y="y")
ppp.col <- readRDS("Maps_Shapes_and_Objects/ppp.col.Rds")
qc.col <- quadratcount(ppp.col, nx = 3, ny = 3)
plot(ppp.col, main = "Conteo por cuadrantes",
     axes = T, xaxt = "n", yaxt = "n")
plot(qc.col, add = T, textargs = list(col = "red"))

quadrat.test(ppp.col)
Warning: Some expected counts are small; chi^2 approximation may be inaccurate

    Chi-squared test of CSR using quadrat counts

data:  ppp.col
X2 = 1720.6, df = 19, p-value < 2.2e-16
alternative hypothesis: two.sided

Quadrats: 20 tiles (irregular windows)

Diggle

Scott

CvL

Frac

PPL